import numpy as np
import os
from girth.synthetic import create_synthetic_irt_dichotomous
from girth import twopl_mml

if __name__ == '__main__':
    dir_path = '/home/boai/lmsd/irt_data'
    loading_paths = [os.path.join(dir_path, f) for f in os.listdir(dir_path)]
    data = np.ones((10, 12))
    for i, path in enumerate(loading_paths):
        data[:,i] = np.loadtxt(path)
    # data = data - np.min(data) / (np.max(data)-np.min(data))
    print(data)
    # Solve for parameters
    estimates = twopl_mml(data)
    print(estimates)

    # # Unpack estimates
    # discrimination_estimates = estimates['Discrimination']
    # difficulty_estimates = estimates['Difficulty']
    # print(discrimination_estimates, difficulty_estimates)